import request from '@/utils/request'

export default {

    getList(key, pageNum, pageSize) {
        return request({
            url: `/changgou-sys/sys/user/queryPageList?pageNum=${pageNum}&pageSize=${pageSize}&key=${key}`,
            method: 'get'
        })
    },

    insert(user) {
        return request({
            url: `/changgou-sys/sys/user/insert`,
            method: 'post',
            data: user
        })
    },

    update(user) {
        return request({
            url: `/changgou-sys/sys/user/update`,
            method: 'post',
            data: user
        })
    },

    delete(id) {
        return request({
            url: `/changgou-sys/sys/user/delete/${id}`,
            method: 'delete'
        })
    },
    getRoleListByUser(id) {
        return request({
            url: `/changgou-sys/sys/user/queryRoleListByUser/${id}`,
            method: 'get'
        })
    },

    insertUserRole(data) {
        return request({
            url: `/changgou-sys/sys/user/insertUserRole`,
            method: 'post',
            data: data
        })
    },

    resetPwd(user) {
        return request({
            url: `/changgou-sys/sys/user/resetPassword`,
            method: 'post',
            data: user
        })
    }
}
